package com.lnsf.bookstore.system.address.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.lnsf.bookstore.common.util.StringUtil;
import com.lnsf.bookstore.system.address.dao.AddressMapper;
import com.lnsf.bookstore.system.address.service.AddressService;
import com.lnsf.bookstore.system.address.vo.Address;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

@Service
public class AddressServiceImpl implements AddressService {

	@Autowired
	private AddressMapper addressMapper;

	@Override
	public PageInfo<Address> queryByUid(Map<String, Object> params) {
		PageHelper.startPage(Integer.parseInt(params.get("page").toString()),Integer.parseInt(params.get("limit").toString()));
		//Integer userId = Integer.parseInt(StringUtil.getStringVal(params.get("userId")));
		return new PageInfo<Address>(addressMapper.selectByUid(params));
	}
}
